package com.asdan.seededu.web.controller;

import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.asdan.seededu.entity.security.Schooldata;
import com.asdan.seededu.service.SchoolService;
import com.asdan.seededu.service.impl.SchoolServiceImpl;
import com.demo2do.core.utils.JsonUtils;
import com.demo2do.core.web.interceptor.MenuSetting;

@Controller
@MenuSetting("menu-data")
@RequestMapping("school")
public class SchoolController {
	
	@RequestMapping(value="/search-school-signature",method=RequestMethod.GET,produces="test/html;charset=UTF-8")
	@ResponseBody
	public String searchSch(String name,Model model){
		System.out.println("name "+name);
		SchoolService ss = new SchoolServiceImpl() ; 
		List<Schooldata> schlist = ss.searchSch(name) ;
		System.out.println(JsonUtils.toJsonString(schlist));
		return JsonUtils.toJsonString(schlist) ;
	}	


}

